-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(trace-tree-node): Mitigating error node type guards usage #104501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(trace-tree-node): Mitigating error node type guards usage #104501
Conversation
…k/trace-tree-node-error-guards-usage
| true | ||
| ); | ||
| const startTimestamp = 'start_timestamp' in event ? event.start_timestamp : undefined; | ||
| // TODO Abdullah Khan: Clean this up once getRepresentativeTraceEvent is moved to the TraceTree class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed this here: #104503
static/app/views/performance/newTraceDetails/traceHeader/meta.tsx
Outdated
Show resolved
Hide resolved
…104503) - Replaced the `getRepresentativeTraceEvent` util to `TraceTree.findRepresentativeTraceNode`. - By doing so we can traverse the generic `baseNode.children` nodes and have access to all new functionality. Also: - Made use of the `baseNode.isEAPEvent` property - Added a `baseNode.traceItemDataset` property --------- Co-authored-by: Abdullah Khan <abdullahkhan@PG9Y57YDXQ.local> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
83bba26
into
abdk/trace-tree-node-uptime-check-guard-usage
| ? rep.event[OurLogKnownFieldKey.ID] | ||
| : rep.event.event_id | ||
| : rep.event.id | ||
| : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Wrong property checked in eventId condition
The condition for extracting eventId checks for OurLogKnownFieldKey.PROJECT_ID in the event, but then accesses OurLogKnownFieldKey.ID. The original code checked OurLogKnownFieldKey.ID in rep.event before accessing the ID field. While this works in practice because logs always contain both fields, it's checking the wrong property and could fail if the data contract changes. The condition should check for the property that's actually being accessed.
No description provided.